<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
    <f:loadBundle basename="shmallarchitect.resources.ShmallResources" var="res"/>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
            <title>
                <h:outputText value="#{res.title} - #{res['register.pageTitle']}"/>
            </title>
            <link href="css/shmall.css" rel="stylesheet" media="screen"></link>
            <link rel="shortcut icon" href="images/favicon.png">
        </head>
        <body><h:form>
                <table width="100%" border="0">
                    <tr>
                        <td colspan="2">
                            <h1 align="center">
                                <h:graphicImage url="/images/shmall_logo.png"
                                                alt="#{res.title}"/>
                                <h:outputText value="#{res.title}" styleClass="LogoTitle"/>
                            </h1>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <f:subview id="loginbar">
                                <jsp:include page="loginbar.jsp"/>
                            </f:subview>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p>
                            <h:outputText value="#{res[\'register.header\']}" styleClass="PageTitle"/></p>

                            <h:messages globalOnly="true" infoClass="RegError"/>

                            <h:panelGrid width="70%" columns="3" border="0">

                                <h:outputLabel value="#{res[\'register.firstName\']}" for="fname" />
                                <h:inputText required="true" id="fname"
                                             binding="#{RegisterMBean.firstName}"/>
                                <h:message for="fname" errorClass="ValidateError"/>

                                <h:outputLabel value="#{res[\'register.lastName\']}" for="lname" />
                                <h:inputText required="true" id="lname"
                                             binding="#{RegisterMBean.lastName}"/>
                                <h:message for="lname" errorClass="ValidateError"/>


                                <h:outputLabel value="#{res[\'register.email\']}" for="email"/>
                                <h:inputText required="true" id="email"
                                             binding="#{RegisterMBean.email}"
                                             validator="#{RegisterMBean.validateEmail}"/>
                                <h:message for="email" errorClass="ValidateError"/>

                                <h:outputLabel value="#{res[\'register.userid\']}" for="login"/>
                                <h:inputText required="true" id="login"
                                             binding="#{RegisterMBean.login}"/>
                                <h:message for="login" errorClass="ValidateError"/>

                                <h:outputLabel value="#{res[\'register.password\']}" for="password"/>
                                <h:inputSecret required="true" id="password"
                                               binding="#{RegisterMBean.password}" />
                                <h:message for="password" errorClass="ValidateError"/>

                                <h:outputLabel value="#{res[\'register.passwordReType\']}" for="password2"/>
                                <h:inputSecret required="true" id="password2"
                                               binding="#{RegisterMBean.passwordCheck}"
                                               validator="#{RegisterMBean.validatePassword}"/>
                                <h:message for="password2" errorClass="ValidateError"/>


                                <f:verbatim>&nbsp;</f:verbatim>
                                <h:panelGroup>
                                    <h:commandButton value="#{res[\'register.registerButton\']}"
                                                     action="#{RegisterMBean.registerUser}" styleClass="NiceButton"/>
                                    <f:verbatim>&nbsp;&nbsp;&nbsp;&nbsp;</f:verbatim>
                                    <h:commandButton value="#{res[\'register.cancelButton\']}" action="cancel"
                                                     immediate="true" styleClass="NiceButton"/>
                                </h:panelGroup>

                            </h:panelGrid>
                        </td>
                        <td align="right">

                            <h:graphicImage url="/images/shopping_logo_tss.jpg"
                                            width="300" height="300" alt="#{res.title}"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <f:subview id="creditsbar">
                                <jsp:include page="creditsbar.jsp"/>
                            </f:subview>
                        </td>
                    </tr>
                </table>
        </h:form></body>
    </html>
</f:view>